package com.fc.v2.controller.admin;

import com.fc.v2.common.base.BaseController;
import com.fc.v2.common.domain.ResultTable;
import com.fc.v2.model.auto.NewUser;
import com.fc.v2.model.auto.TsysUser;
import com.fc.v2.model.custom.Tablepar;
import com.fc.v2.service.NewUserService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Api(value = "用户数据")
@Controller
@RequestMapping("/NewUserController")
public class NewUserController extends BaseController {

    @Resource
    private NewUserService newUserService;

    private final String prefix = "admin/user";

    /**
     * list集合
     * @param tablepar
     * @param searchText
     * @return
     * @author fuce
     * @Date 2019年11月11日 下午4:14:40
     */
    //@Log(title = "分页查询", action = "1")
    @ApiOperation(value = "分页查询", notes = "分页查询")
    @GetMapping("/list")
    @ResponseBody
    public ResultTable list(Tablepar tablepar){
        PageInfo<NewUser> page=newUserService.list(tablepar) ;
        return pageTable(page.getList(),page.getTotal());
    }

    @ApiOperation(value = "分页跳转", notes = "分页跳转")
    @GetMapping("/view")
    @RequiresPermissions("system:user:view")
    public String view(ModelMap model)
    {
        return prefix + "/list";
    }



}
